﻿using FastExecutor.Message.Annotation;
using FastExecutor.Message.Design;
using FastIOC.Annotation;
using FastORM.Applicaiton;
using Newtonsoft.Json;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastExecutor.Message.Base.Design
{
    [Component]
    [MessageChanelAttribute(ChannelName = "DefaultMessage")]
    public class FastDefaultMessageHandler : IFastMessageHandle
    {
        [AutoWired]
        public DBUtil @DBUtil;

        public void HandleMessage(RedisChannel ChannelName, RedisValue Message)
        {

            FastExecutor.Message.Design.Message Entity = JsonConvert.DeserializeObject<FastExecutor.Message.Design.Message>(Message);
            this.CustomHandle(Entity);
        }

        public virtual void CustomHandle(FastExecutor.Message.Design.Message @Message)
        {

        }
    }
}
